package models

type Advertisement struct {
	ID                string  `json:"id" gorm:"column:id;primaryKey;type:int;size:64;comment:主键,订单号"`
	CreatedAt         int64   `json:"created_at" gorm:"column:created_at;type:int;size:64;comment:创建时间"`
	CustomName        string  `json:"custom_name" gorm:"column:custom_name;type:varchar(200);comment:姓名"`
	PhoneNumber       string  `json:"phone_number" gorm:"column:phone_number;type:varchar(200);comment:电话"`
	DeviceIDs         string  `json:"device_ids" gorm:"column:device_ids;type:varchar(8192);comment:设备ID数组"`
	StartAt           int64   `json:"start_at" gorm:"column:start_at;type:int;size:64;comment:起始时间"`
	EndAt             int64   `json:"end_at" gorm:"column:end_at;type:int;size:64;comment:终止时间"`
	Status            int     `json:"pay_status" gorm:"column:pay_status;type:int;size:64;comment:支付状态"`
	Remark            string  `json:"remark" gorm:"column:remark;type:varchar(1024);comment:备注"`
	OpenID            string  `json:"openid" gorm:"column:openid;type:varchar(1024);comment:用户openid"`
	AdvertisementID   string  `json:"advertisement_id" gorm:"column:advertisementid;type:varchar(1024);comment:advertisement_id"`
	PayAmount         float32 `json:"pay_amount" gorm:"column:pay_amount;type:decimal(10,2);default:0.00;comment:支付金额计算优惠"`
	PaidAmount        float32 `json:"paid_amount" gorm:"column:paid_amount;type:decimal(10,2);default:0.00;comment:已支付金额"`
	PaidID            string  `json:"paid_id" gorm:"column:paid_id;type:varchar(1024);comment:支付订单号"`
	DiscountAmount    float32 `json:"discount_amount" gorm:"column:discount_amount;type:decimal(10,2);default:0.00;comment:下单时优惠一共减免数"`
	ScheduleID        string  `json:"schedule_id" gorm:"column:schedule_id;type:varchar(128);comment:投放计划ID"`
	ScheduleStatus    int     `json:"pschedule_status" gorm:"column:pschedule_status;type:int;size:64;comment:投放计划状态"`
	SupportActivityID string  `json:"support_activity_id" gorm:"column:support_activity_id;type:varchar(200);comment:应援活动id"`
}

func (Advertisement) TableName() string {
	return "advertisement"
}

// 模式自动注册
func init() {
	Models = append(Models, &Advertisement{})
}
